package com.winderinfo.yikaotianxia.core.mvp;

import java.util.Map;

public interface Contract {
    //m
    interface Model {
        //url  数据路径   map   入参参数  kind   bean包   callBack  接口回调
        void get(String url, Map<String, Object> map, Class kind, CallBack callback);

        void post(String url, Map<String, Object> map, Class kind, CallBack callBack);

        void delete(String url, Map<String, Object> map, Class kind, CallBack callBack);

        void put(String url, Map<String, Object> map, Class kind, CallBack callBack);

        //头像上传
        void imagePast(String url, Map<String, String> map, Class kind, CallBack callBack);
    }

    //p
    interface Presenter {
        void onGetRequest(String url, Map<String, Object> map, Class kind);

        void onPostRequest(String url, Map<String, Object> map, Class kind);

        void onPutRequest(String url, Map<String, Object> map, Class kind);

        void onDeleteRequest(String url, Map<String, Object> map, Class kind);

        void imagePost(String url, Map<String, String> map, Class kind);
    }

    //v
    interface View<T> {
        //成功方法
        void onSuccess(T data);

        //失败方法
        void onFailure(T error);
    }

    //接口回调
    interface CallBack<T> {
        //成功方法
        void onSuccess(T data);

        //失败方法
        void onFailure(T error);
    }
}
